package com.sprouting.personal.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sprouting.personal.dao.PsJotDownDao;
import com.sprouting.personal.model.entity.PsJotDown;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 随手记
 *
 * @author ：LX（长沙麓谷）
 * @date 创建时间： 2022/12/20 16:28
 */
@Service
@Slf4j
public class PsJotDownService extends ServiceImpl<PsJotDownDao, PsJotDown> {

    @Resource
    private PsJotDownDao psJotDownDao;

    /**
     * 根据主键查询随手记
     * @param id 随手记主键
     * @return
     */
    public PsJotDown getJotDownById(String id) {
        return psJotDownDao.getJotDownById(id);
    }

    /**
     * 分页查询随手记
     * @param page 分页参数
     * @param checkValue 是否选中，非必填
     * @param userId 当前用户ID
     * @return
     */
    public Page<PsJotDown> getJotDownListPage(Page page, Integer checkValue, String userId) {
        return psJotDownDao.getJotDownListPage(page, checkValue, userId);
    }
}
